﻿Public Class CuentaContable


    Private m_codigo As Integer
    Private m_descripcion As String
    Private m_saldo As Double


    Public Sub New()

    End Sub

    Public Sub New(ByVal p_codigo As Integer, ByVal p_descripcion As String, ByVal p_saldo As Double)

        m_codigo = p_codigo
        m_descripcion = p_descripcion
        m_saldo = p_saldo

    End Sub

    Public Property codigo() As Integer
        Get
            Return m_codigo
        End Get
        Set(ByVal p_codigo As Integer)
            m_codigo = p_codigo
        End Set
    End Property

    Public Property descripcion() As String
        Get
            Return m_descripcion
        End Get
        Set(ByVal p_descripcion As String)
            m_descripcion = p_descripcion
        End Set
    End Property

    Public Property saldo() As Double
        Get
            Return m_saldo
        End Get
        Set(ByVal p_saldo As Double)
            m_saldo = p_saldo
        End Set
    End Property

    Public Function toHashTable(ByVal p_cuenta As CuentaContable) As Hashtable
        Dim datoCuenta As New Hashtable()

        datoCuenta.Add("codigo", p_cuenta.codigo)
        datoCuenta.Add("descripcion", p_cuenta.descripcion)
        datoCuenta.Add("saldo", p_cuenta.saldo)

        Return datoCuenta
    End Function

End Class
